--[[-------------------------------------------------------

Fight to Survive: Stronghold by RoaringCow, TehBigA is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.

This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License. 
To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/3.0/ or send a letter to Creative Commons, 
444 Castro Street, Suite 900, Mountain View, California, 94041, USA.

---------------------------------------------------------]]

-- These are some things that could be replaced with newer code, but really isn't that much less efficient

FORCE_STRING, FORCE_NUMBER, FORCE_BOOL = 1, 2, 3
function AccessorFuncNW( tab, varname, name, varDefault, iForce )
	tab[ "Get"..name ] = function( self ) return self:GetNetworkedVar( varname, varDefault ) end

	if iForce == FORCE_STRING then
		tab[ "Set"..name ] = function( self, v ) self:SetNetworkedVar( varname, tostring(v) ) end
	elseif iForce == FORCE_NUMBER then
		tab[ "Set"..name ] = function( self, v ) self:SetNetworkedVar( varname, tonumber(v) ) end
	elseif iForce == FORCE_BOOL then
		tab[ "Set"..name ] = function( self, v ) self:SetNetworkedVar( varname, tobool(v) ) end
	else
		tab[ "Set"..name ] = function( self, v ) self:SetNetworkedVar( varname, v ) end
	end
end


-- WHAT THE FUCK GARRY WHAT THE FUCK IM GETTING REAL SICK OF YOUR SHIT -RoaringCow

local _fIsValid = IsValid
function _G.IsValid( wut )
	local fuck, shit = pcall( _fIsValid, wut ) --fucking why do i keep having to write hacks for the smallest things -Ultra

	if fuck then
		return shit
	else
		return false
	end
end